﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Configuration;
namespace QuanTriHeThongKhoDiaChinh
{
   public class TaoKetNoi
    {
       public static SqlConnection conn;
        public SqlConnection KetNoi(string server, string database, string user, string pwd)
        {             
            try
            {
                
                //string connectionString = ConfigurationSettings.AppSettings["connectionStrings"].ToString();
                string connectionString = @"server=" + server + ";database=" + database + ";user=" + user + ";pwd=" + pwd + "";
                conn = new SqlConnection(connectionString);
                return conn;
            }
            catch (SqlException sqlEx)
            {
                throw sqlEx;
            }
        }
    }
}
